Skip to content

Conversation

@minggangw
Copy link
Member

@minggangw minggangw commented Jul 21, 2025

This PR fixes incorrect relative import paths in example files to properly reference the main index.js file. The changes update require statements to use the correct number of directory traversals based on each file's location within the example folder structure.

  • Updates require paths from ../index.js to appropriate relative paths (../../index.js or ../../../index.js)
  • Corrects rosidl parser imports to use proper relative paths
  • Removes unused imports and fixes a syntax error in one file

Fix: #1202

@minggangw minggangw requested a review from Copilot July 21, 2025 09:43
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes incorrect relative import paths in example files to properly reference the main index.js file. The changes update require statements to use the correct number of directory traversals based on each file's location within the example folder structure.

  • Updates require paths from ../index.js to appropriate relative paths (../../index.js or ../../../index.js)
  • Corrects rosidl parser imports to use proper relative paths
  • Removes unused imports and fixes a syntax error in one file

Reviewed Changes

Copilot reviewed 30 out of 30 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
example/topics/validator/validator-example.js Updates rclnodejs import path from ../index.js to ../../../index.js
example/topics/subscriber/*.js Updates rclnodejs import paths to use correct relative path ../../../index.js
example/topics/publisher/*.js Updates rclnodejs import paths to use correct relative path ../../../index.js
example/timer/timer-example.js Updates rclnodejs import path to ../../index.js
example/services/*/*.js Updates rclnodejs import paths to use correct relative path ../../../index.js
example/rosidl/*.js Updates parser import paths and fixes syntax error in action example
example/rate/rate-example.js Updates rclnodejs import path to ../../index.js
example/parameter/*.js Updates rclnodejs import paths to use correct relative path ../../index.js
example/lifecycle/lifecycle-node-example.js Updates rclnodejs import path to ../../index.js
example/graph/ros-graph-example.js Updates rclnodejs import path to ../../index.js
example/actions/*/*.js Updates rclnodejs import paths and removes unused imports


const parser = require('../rosidl_parser/rosidl_parser.js');

s;
Copy link

Copilot AI Jul 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line contains invalid syntax 's;' which should be removed or replaced with the correct parser import statement.

Copilot uses AI. Check for mistakes.
@minggangw minggangw merged commit 56d62d7 into RobotWebTools:develop Jul 21, 2025
18 checks passed
@coveralls
Copy link

Coverage Status

coverage: 84.526%. remained the same
when pulling a14ab6a on minggangw:fix-1202
into 0a33ec0 on RobotWebTools:develop.

minggangw added a commit that referenced this pull request Jul 22, 2025
This PR fixes incorrect relative import paths in example files to properly reference the main index.js file. The changes update require statements to use the correct number of directory traversals based on each file's location within the example folder structure.

- Updates require paths from `../index.js` to appropriate relative paths (`../../index.js` or `../../../index.js`)
- Corrects rosidl parser imports to use proper relative paths
- Removes unused imports and fixes a syntax error in one file

Fix: #1202
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Correct the required path for example

2 participants